package com.example.game.hff;

import java.awt.Graphics;
import java.awt.Image;

public class Item implements Constants {

	private Image image;
	private int x, y;
		
	public Item(Image image) {
		this.image = image;
		
		int h = SCREEN_HEIGHT / 4;
		x = (int)(Math.random() * (SCREEN_WIDTH - image.getWidth(null)));
		y = (int)(Math.random() * h) + 50;
	
	}
	
	public void draw(Graphics g) {
		g.drawImage(image, x, y, null);
	}	
	
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	
	public int getWidth() {
		return image.getWidth(null);
	}
	public int getHeight() {
		return image.getHeight(null);
	}
	
}
